e
#Title[ʏ1]
#Text[gCEUNV
HXqʏ1]
#BackGround[User]
#BGM[.\..\bgm\bgm.wav]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	
	////////////////////////////////////////////////////////////////////////
	//                                                          //
	//   e摜{Ƃlʏۂ                                 //
	//   e̓WJpxAWJύX                                     //
	////////////////////////////////////////////////////////////////////////
	
	@Initialize{
		InitializeData();
		
		LoadUserShotData(shot_ryoyan);
		
		SetLife(4000);
		SetDamageRate(120,100);
		SetMovePosition03(GetCenterX(),120,10,8);
		SetInvincibility(120);
		SetCollisionEx(32,16);
		SetEnemyMarker(true);
		
		TMain();
	}
	
	@MainLoop{
		yield;
	}
	
	@DrawLoop{
		DrawBoss(imgBoss);
	}
	
	@Finalize{
		FinalizeData();
	}
	
	task TMain(){
		wait(120);
		
		SetTimer(60);
		
		Atack();
		Move();
	}
	
	task Atack(){
		loop{
			b();
			loop(2){
				a();
				wait(160);
			}
		}
	}
	
	function a(){
		let angle = rand(0,360);
		
		ascent(i in 0..12 * 10){
			CreateShotA(0,GetX(),GetY(),0);
			SetShotDataA(0,0,0,angle + i * 36,3,0.05,10,_BLUE01());
			SetShotDataA(0,100,NULL,NULL,3,-0.08,0,NULL);
			SetShotDataA(0,150,NULL,i * 36 + trunc(i / 12) * 20,0,0.02,4,_BLUE22());
			FireShot(0);
		}
	}
	
	task b(){
		let angle = rand(0,360);
		let x = 0;
		let y = 0;
		
		ascent(i in 0..120){
			if(i == 30 || i == 60){
				wait(20);
			}
			
			x = GetX() + cos(angle - i * 9) * 42;
			y = GetY() + sin(angle - i * 9) * 42;
			
			ascent(j in -2..3) {
				CreateShot01(x,y,2.5,angle - i * 9 + j * 20 + 90,_YELLOW11(),10);
			}
			
			wait(2);
		}
	}
	
	task Move(){
		let tm=0;
		
		wait(90);
		
		loop{
			if( GetX() < GetPlayerX() ){
				tm = 50;
			}else{
				tm = -50;
			}
			
			SetMovePosition03(GetX() + ( tm / rand(1,2) ),rand(125,135),20,16);
			
			wait(250);
		}
	}
	
	#include_function ".\..\functions\initialize.txt"
	#include_function ".\..\functions\color_set.txt"
	#include_function ".\..\functions\function.txt"
}
